]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
endSessionDialog: Don't error out if gnome-session hands us a dead inhibitor
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 22 Aug 2013 20:14:14 +0000 (16:14 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 22 Aug 2013 21:16:38 +0000 (17:16 -0400)
Sometimes gnome-session hands us a bad object path for JIT inhibitors
it creates for XSMP clients. While this is a bug in gnome-session, we
shouldn't show an empty-looking dialog here.

https://bugzilla.gnome.org/show_bug.cgi?id=706612

js/ui/endSessionDialog.js

index 48ff151bf56cac822a1c02724b07ad66b6bd5ec9..99525933b273dda315a57f3c3ae802ac65ae96db 100644 (file)
@@ -118,7 +118,15 @@ const DialogContent = {
 };
 
 function findAppFromInhibitor(inhibitor) {
-    let [desktopFile] = inhibitor.GetAppIdSync();
+    let desktopFile;
+    try {
+        [desktopFile] = inhibitor.GetAppIdSync();
+    } catch(e) {
+        // XXX -- sometimes JIT inhibitors generated by gnome-session
+        // get removed too soon. Don't fail in this case.
+        log('gnome-session gave us a dead inhibitor: %s'.format(inhibitor.get_object_path());
+        return null;
+    }
 
     if (!GLib.str_has_suffix(desktopFile, '.desktop'))
         desktopFile += '.desktop';